package com.lenovo.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.lenovo.dao.BaseDAO;
import com.lenovo.model.GProxyIp;
import com.lenovo.service.ProxyIpService;
@Repository
public class ProxyIpServiceImpl implements ProxyIpService{
	
	@Resource
	private BaseDAO dao ;

	@Override
	public List<GProxyIp> browse() {
		return dao.listAll("GProxyIp");
	}

	@Override
	public GProxyIp loadProxyIp(Integer id) {
		return (GProxyIp)dao.loadById(GProxyIp.class, id);
	}

	@Override
	public boolean delProxyIp(Integer id) {
		boolean status = false;
		try{
			dao.delById(GProxyIp.class, id);
			status = true;
		}catch(Exception ex){
			ex.printStackTrace();
		}	
		return status;
	}

	@Override
	public boolean saveOrUpdateProxyIp(GProxyIp rule) {
		boolean status = false;
		try{
			dao.save(rule);
			status = true;
		}catch(Exception ex){
			ex.printStackTrace();
		}	
		return status;
	}

}
